/**
 * 获取位置
 * @param e 
 * @returns 
 */
export function getXY(e: MouseEvent | Event) {
    const me = e as MouseEvent;
    return {
        x: me.offsetX,
        y: me.offsetY
    }
}

let ID = 0;
/**
 * 生成唯一ID
 * @returns 
 */
export function UUID() {
    return String(++ID);
}

/**
 * 
 * @param id 
 * @returns 
 */
export function $(id: string): HTMLElement | null {
    return document.getElementById(id);
}